#!/bin/sh

#更新源
echo "更新源"
sudo apt-get update -y



echo "创建文件夹:home,proj"
cur=`pwd`
#创建已经有的文件夹
cd /
mkdir home
cd home
mkdir proj
cd proj
echo "安装openresty"
wget https://openresty.org/download/openresty-1.19.3.1.tar.gz
tar -zxvf openresty-1.19.3.1.tar.gz

mv openresty-1.19.3.1 openresty
cd openresty

sudo apt-get install libpcre3-dev \
libssl-dev perl make build-essential curl unzip -y


./configure
make
make install

echo "openresty环境变量"
echo "PATH=/usr/local/openresty/bin:/usr/local/openresty/nginx/sbin:$PATH
export  LC_ALL=en_US.UTF-8
export PATH" >> ~/.bash_profile

source ~/.bash_profile